﻿Public Class UjiCoba
    Dim i As Integer
    Dim ListSekolah_u As New cls_list

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        cmb_list.Items.Clear()

        For Me.i = 0 To ListSekolah_u.List.Count - 1
            cmb_list.Items.Add(ListSekolah_u.List.Item(Me.i).Nama)
        Next

    End Sub

    Private Sub UjiCoba_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ListSekolah_u.Add(1, "201", "SMP NEGERI 1 BANDUNG", 1)
        ListSekolah_u.Add(2, "202", "SMP NEGERI 2 BANDUNG", 1)
        ListSekolah_u.Add(3, "203", "SMP NEGERI 3 BANDUNG", 2)
        ListSekolah_u.Add(4, "204", "SMP NEGERI 4 BANDUNG", 2)
        ListSekolah_u.Add(5, "205", "SMP NEGERI 5 BANDUNG", 3)

        MaskedTextBox1.Text = "02"
        MaskedTextBox1.Focus()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        MsgBox(ListSekolah_u.getKode(cmb_list.Text))
    End Sub

    Private Sub cmb_list_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_list.SelectedIndexChanged
        txt_kluster.Text = ListSekolah_u.getKluster(cmb_list.Text)
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        MsgBox(MaskedTextBox1.Text)
    End Sub

    
    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Dim i As Integer

        For i = 301 To 329

            ListBox1.Items.Add(GenerateKey(i))

        Next

    End Sub
End Class